package com.mz.mattress.client;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.socket.config.annotation.EnableWebSocket;

import java.util.Map;
import java.util.concurrent.Executor;

@Slf4j
@EnableTransactionManagement
@EnableWebSocket
//@EnableAsync
@SpringBootApplication(exclude = {SecurityAutoConfiguration.class}, scanBasePackages = {"com.mz.mattress"})
public class ClientApplication {

    public static void main(String[] args) {

        ConfigurableApplicationContext context = SpringApplication.run(ClientApplication.class, args);
        Environment environment = context.getBean(Environment.class);
        log.info("ActiveProfile=" + environment.getActiveProfiles()[0]);
        log.info("http://localhost:" + environment.getProperty("local.server.port"));

//        ArticleMapper bean = context.getBean(ArticleMapper.class);
//        bean.updateSort("hot",1,2);
//        System.out.println("dd");

//        Map<String, Executor> beansOfType = context.getBeansOfType(Executor.class);
//        System.out.println(beansOfType.size());

//        String[] beanNamesForType = context.getBeanNamesForType(Animal.class);
//        for (String ss : beanNamesForType) {
//            System.out.println(ss);
//        }

    }

}



